<?php

use app\migrations\BaseMigration;

/**
 * Class m210809_014216_books
 */
class m210809_014216_books extends BaseMigration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->createTable('{{%books}}', [
            'id' => $this->primaryKey(),
            'name' => $this->string(32)->notNull()->defaultValue(''),
            'author' => $this->string(32)->notNull()->defaultValue(''),
            'type' => $this->string(32)->notNull()->defaultValue(''),
            'press' => $this->string(32)->notNull()->defaultValue('')
        ], $this->getOptions());
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        echo "m210809_014216_books cannot be reverted.\n";

        return false;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m210809_014216_books cannot be reverted.\n";

        return false;
    }
    */
}
